package com.zgkxzx.androidtest;

import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.zgkxzx.算法.大数处理.BigNumber;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.zgkxzx.android.androidtest", appContext.getPackageName());
    }

    @Test
    public void test() throws Exception{
        String value = BigNumber.multiOperate("123", "234");

        assertEquals("28782",value);
    }

    @Test
    public void login() throws Exception{
        Context appContext = InstrumentationRegistry.getTargetContext();
        Intent intent = new Intent(appContext, com.zgkxzx.androidtest.SecondActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        appContext.startActivity(intent);
    }

}
